require "class"

ChatRecord = class("ChatRecord")

function ChatRecord:ctor(sender, receiver, content)
    sender = sender or '无发送者'
    receiver = receiver or '无接收者'
    content = content or '无内容'

    self.sender = sender
    self.receiver = receiver
    self.content = content
end

-- tostring
function ChatRecord:__tostring()
    return ("sender:" .. self.sender .. " receiver:" .. self.receiver .. " content:" .. self.content)
end

function ChatRecord:simple()
    return {
        sender = self.sender,
        receiver = self.receiver,
        content = self.content
    }
end
